#ifndef CMD_READER_H 
#define CMD_READER_H  

#include "cmd_user_session.h"

#include <string>

namespace vpm
{
	namespace cmo 
	{
		class CmdReader
		{
		public:

			CmdReader();

			virtual ~CmdReader();
		
			virtual char read_char() { return '0';}

			virtual std::string read_string() {return std::string();}  //same as readline 

			virtual void write_char(char ch){}

			virtual void write_string(const char * pStr) {}

			//virtual void write_string(const std::string &str) {}

			virtual void read();

			void stop_read()
			{
				m_bRunning = false; 
			}

		protected:
			std::string read_user();
			std::string read_password();					
			virtual void process_char(char ch);		
			CmdUserSessionPtr m_cmdUserSession; 
			
			CmdViewPtr m_cmdView; 
			bool m_bRunning;
		};
	}
}


#endif // 

